const Koa=require('koa');
const routerMiddl=require('./router');
const bodyparser=require('koa-bodyparser');
const cors=require('koa-cors')

const {sync}=require('./model');
const { user } = require('pg/lib/defaults');

let app=new Koa();

//调用封装后的模型同步函数
 sync();




app.use(cors());
app.use(bodyparser());
app.use(routerMiddl());


let port=8000;
app.listen(port);

console.log(`运行在以下地址： http://localhost:${port}`);